#include<iostream>
#include<string>
using namespace std;
const int N = 1e5+10;
typedef long long ll;
int a[N];   //输入数据数组
int b[N];   //全程在差分数组操作
//在[l,r]范围+c
void insert(int l,int r,int c)
{
    //在差分数组操作
    b[l]+=c;
    b[r+1]-=c;
}
int main()
{
    ll n, m;
    cin >> n >> m;
    for (ll i = 1; i <= n; i++) 
    {
        cin >>a[i];
        insert(i,i,a[i]);   //相当于在[i,i]范围+a[i]
    }
    //在[l,r]范围+c
    while(m--)
    {
        int l,r,c; cin>>l>>r>>c;
        insert(l,r,c);
    }
    //计算差分数组的前缀和
    for(ll i=1;i<=n;i++)
    {
        b[i]+=b[i-1];   //前缀和
        //s[i]=s[i-1]+a[i];
        cout<<b[i]<<" ";
    }
    return 0;
}